import logging
import time

class Logger():

    def __init__(self):

        self.logger = logging.getLogger()
        self.logger.setLevel(logging.DEBUG)

        fh = logging.FileHandler(filename=f".\log\{time.strftime('%Y-%m-%d')}.log", encoding='utf-8')
        fh.setLevel(logging.INFO)

        ch = logging.StreamHandler()
        ch.setLevel(logging.DEBUG)

        famater = logging.Formatter("%(asctime)s|%(levelname)s|%(filename)s|%(lineno)s|%(message)s")

        fh.setFormatter(famater)
        ch.setFormatter(famater)

        self.logger.addHandler(fh)
        self.logger.addHandler(ch)

logger = Logger().logger
